Indicates if an X.509 certificate exists in the certificate store.
Syntax:
Parameters:
- sSubjectName – Optional. Subject name of the certificate to search for.
- sIssuerName - Optional. Issuer name of the certificate to search for.
- sHexSerialNumber - Optional. Serial number of certificate in hexadecimal string.
Returns:
Returns 1 if the certrificate is found; otherwise 0 if not found.
Remarks:
All the search parameters are optional. However, one or some parameters must be entered otherwise an error is generated. Entering more search parameters results in a more accurate find of the certificate. Currently the allowed search combinations are:
- IsCertificateExists(sSubjectName, sIssuerName, sHexSerialNumber)
- IsCertificateExists(sSubjectName, sIssuerName)
- IsCertificateExists(sSubjectName, sHexSerialNumber)
- IsCertificateExists(sSubjectName)
- IsCertificateExists(sIssuerName, sHexSerialNumber)
Example:
Dim oEdiDoc As Fredi.ediDocument
Dim oSecurities As Fredi.ediSecurities
Dim oCertificateStore As Fredi.ediSecurityCertificateStore
Dim oCertificateStores As Fredi.ediSecurityCertificateStores
Dim oCertStoreLocation As Fredi.ediSecurityCertStoreLocations
' Create instance of Framework EDI.
Set oEdiDoc = New Fredi.ediDocument
' Get securities object.
Set oSecurities = oEdiDoc.GetSecurities
' Get the My certificate store
Set oCertStoreLocation = oSecurities.GetCertificateStoreLocations
Set oCertificateStores = oCertStoreLocation.GetCertificateStores("CurrentUser")
Set oCertificateStore = oCertificateStores.GetCertificateStore("My")
Dim sCertName As String
sCertName = "EDIDEV SRV DEMO COMPANY"
If oCertificateStore.IsCertificateExists(sCertName, "", "") Then
MsgBox "Certificate " & sCertName & " found."
Else
MsgBox "Certificate " & sCertName & " not found."
End If